package edu.lmu.cs.dhara.roflkode.entities;

import java.util.Collections;
import java.util.List;

import edu.lmu.cs.dhara.util.Log;

/**
 * The roflkode WTF statement.
 */
public class SwitchStatement extends Statement {
    private List<Case> cases;
    private Expression expression;

    /**
     * Create a switch statement with a complete list of cases.
     */
    public SwitchStatement(Expression expression, List<Case> cases) {
    	this.expression = expression;
        this.cases = cases;
    }

    /**
     * Create an switch statement that has only a single case (no else
     * or else if parts).
     */
//    public ConditionalStatement(Case c) {
//        this.cases = Collections.singletonList(c);
//    }

    /**
     * Returns the cases.
     */
    public List<Case> getCases() {
        return cases;
    }
    
    /**
     * Returns the match expression.
     */
    public Expression getExpression() {
    	return expression;
    }

    /**
     * Analyzes the switch statement (by analyzing each case).
     */
    public void analyze(Log log, SymbolTable table, Function f, boolean inLoop) {
//        for (Case c: cases) {
//            c.analyze(log, table, f, inLoop);
//        }
    }
}
